local linglong = fk.CreateSkill {
  name = "mini__linglong",
  tags = { Skill.Compulsory },
}

Fk:loadTranslationTable{
  ["mini__linglong"] = "玲珑",
  [":mini__linglong"] = "锁定技，若你的装备区：<br>没有防具牌，你视为装备着【八卦阵】；<br>没有坐骑牌，你的手牌上限+2；<br>"..
  "没有牌，你使用【杀】和普通锦囊牌不能被响应。",

  ["$mini__linglong1"] = "心窍玲珑，巧思速出！",
  ["$mini__linglong2"] = "天工巧器，不及吾玲珑之心！",
}

linglong:addEffect(fk.CardUsing, {
  anim_type = "offensive",
  can_trigger = function(self, event, target, player, data)
    return target == player and player:hasSkill(linglong.name) and
      (data.card.trueName == "slash" or data.card:isCommonTrick()) and
      #player:getCardIds("e") == 0
  end,
  on_use = function(self, event, target, player, data)
    data.disresponsiveList = table.simpleClone(player.room.players)
  end,
})

local spec = function (self, event, target, player, data)
  local room = player.room
  room:broadcastPlaySound("./packages/standard_cards/audio/card/eight_diagram")
  room:setEmotion(player, "./packages/standard_cards/image/anim/eight_diagram")
  local skill = Fk.skills["#eight_diagram_skill"]
  skill:use(event, target, player, data)
end

linglong:addEffect(fk.AskForCardUse, {
  anim_type = "defensive",
  can_trigger = function(self, event, target, player, data)
    return target == player and player:hasSkill(linglong.name) and not player:isFakeSkill(self) and
      (data.cardName == "jink" or (data.pattern and Exppattern:Parse(data.pattern):matchExp("jink|0|nosuit|none"))) and
      #player:getEquipments(Card.SubtypeArmor) == 0 and
      Fk.skills["#eight_diagram_skill"] ~= nil and Fk.skills["#eight_diagram_skill"]:isEffectable(player)
  end,
  on_cost = function(self, event, target, player, data)
    return player.room:askToSkillInvoke(player, {
      skill_name = linglong.name,
    })
  end,
  on_use = spec,
})

linglong:addEffect(fk.AskForCardResponse, {
  anim_type = "defensive",
  can_trigger = function(self, event, target, player, data)
    return target == player and player:hasSkill(linglong.name) and not player:isFakeSkill(self) and
      (data.cardName == "jink" or (data.pattern and Exppattern:Parse(data.pattern):matchExp("jink|0|nosuit|none"))) and
      #player:getEquipments(Card.SubtypeArmor) == 0 and
      Fk.skills["#eight_diagram_skill"] ~= nil and Fk.skills["#eight_diagram_skill"]:isEffectable(player)
  end,
  on_cost = function(self, event, target, player, data)
    return player.room:askToSkillInvoke(player, {
      skill_name = linglong.name,
    })
  end,
  on_use = spec,
})

linglong:addEffect("maxcards", {
  correct_func = function(self, player)
    if player:hasSkill(linglong.name) and
      #player:getEquipments(Card.SubtypeOffensiveRide) + #player:getEquipments(Card.SubtypeDefensiveRide) == 0 then
      return 2
    end
  end,
})

return linglong
